import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'plugin_secure_store_method_channel.dart';

abstract class PluginSecureStorePlatform extends PlatformInterface {
  /// Constructs a PluginSecureStorePlatform.
  PluginSecureStorePlatform() : super(token: _token);

  static final Object _token = Object();

  static PluginSecureStorePlatform _instance = MethodChannelPluginSecureStore();

  /// The default instance of [PluginSecureStorePlatform] to use.
  ///
  /// Defaults to [MethodChannelPluginSecureStore].
  static PluginSecureStorePlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [PluginSecureStorePlatform] when
  /// they register themselves.
  static set instance(PluginSecureStorePlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  /// 生成一对RSA密钥, 返回公钥 Base64 字符串
  Future<String?> generateRSA(String alias) {
    throw UnimplementedError('generateRSA() has not been implemented.');
  }

  /// 使用RSA公钥进行加密, 返回加密后的 Base64 字符串
  Future<String?> encryptRSA(String alias, String content) {
    throw UnimplementedError('encryptRSA() has not been implemented.');
  }

  /// 使用RSA私钥进行解密, 返回解密后的字符串
  /// @params content 入参需要 Base64 编码过的字符串
  Future<String?> decryptRSA(String alias, String content) {
    throw UnimplementedError('decryptRSA() has not been implemented.');
  }

  Future<String?> decryptBigRSA(String alias, String content) {
    throw UnimplementedError('decryptBigRSA() has not been implemented.');
  }

}
